package com.ruoyi.tea.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tea.mapper.TeaSearchMapper;
import com.ruoyi.tea.domain.TeaSearch;
import com.ruoyi.tea.service.ITeaSearchService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户搜索记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-31
 */
@Service
public class TeaSearchServiceImpl implements ITeaSearchService 
{
    @Autowired
    private TeaSearchMapper teaSearchMapper;

    /**
     * 查询用户搜索记录
     * 
     * @param id 用户搜索记录主键
     * @return 用户搜索记录
     */
    @Override
    public TeaSearch selectTeaSearchById(Long id)
    {
        return teaSearchMapper.selectTeaSearchById(id);
    }

    /**
     * 查询用户搜索记录列表
     * 
     * @param teaSearch 用户搜索记录
     * @return 用户搜索记录
     */
    @Override
    public List<TeaSearch> selectTeaSearchList(TeaSearch teaSearch)
    {
        return teaSearchMapper.selectTeaSearchList(teaSearch);
    }

    @Override
    public List<TeaSearch> selectTeaSearchHistoryList(TeaSearch teaSearch) {
        return teaSearchMapper.selectTeaSearchHistoryList(teaSearch);
    }

    /**
     * 新增用户搜索记录
     * 
     * @param teaSearch 用户搜索记录
     * @return 结果
     */
    @Override
    public int insertTeaSearch(TeaSearch teaSearch)
    {
        teaSearch.setCreateTime(DateUtils.getNowDate());
        return teaSearchMapper.insertTeaSearch(teaSearch);
    }

    /**
     * 修改用户搜索记录
     * 
     * @param teaSearch 用户搜索记录
     * @return 结果
     */
    @Override
    public int updateTeaSearch(TeaSearch teaSearch)
    {
        return teaSearchMapper.updateTeaSearch(teaSearch);
    }

    /**
     * 批量删除用户搜索记录
     * 
     * @param ids 需要删除的用户搜索记录主键
     * @return 结果
     */
    @Override
    public int deleteTeaSearchByIds(String ids)
    {
        return teaSearchMapper.deleteTeaSearchByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户搜索记录信息
     * 
     * @param id 用户搜索记录主键
     * @return 结果
     */
    @Override
    public int deleteTeaSearchById(Long id)
    {
        return teaSearchMapper.deleteTeaSearchById(id);
    }
}
